package com.googlecode.particlesys.templates;

import java.awt.Color;
import java.util.Random;

import com.googlecode.particlesys.objects.AbstractEmitter;
import com.googlecode.particlesys.objects.Particle;

public class Fountain extends AbstractEmitter {
	
	private static final Random RANDOM = new Random();

	public Fountain(int x, int y){
		super(4, 4, x, y, 300, 2);
	}

	@Override
	public Particle getNextParticle() {
		Particle p = new Particle(Color.CYAN, width, height);
		p.setX(x);
		p.setY(y);
		p.setSpeed(5);
		p.setAngle(45+RANDOM.nextInt(135-45));
		p.setLife(100);
		return p;
	}
}